<ion-header>
  <ion-navbar #navbar>
    <ion-title>添加场景按钮</ion-title>
    <ion-buttons end (click)="save()">
      <button [ngClass]="{'disable':scene.actions.length == 0}" ion-button>
        保存
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content>
  <div class="show-scene-button">
    <scene-button [scene]="scene" [enable]="enable"></scene-button>
    <div class="btn-box">
      <div class="btn" (click)="choseIcon()">修改图标</div>
      <div class="btn" (click)="changeName()">修改名称</div>
    </div>
  </div>
  <div class="setting-title">
    当你按下按键时，将执行以下动作
  </div>
  <div class="device-table">
    <ion-scroll #scrollContainer class="scroll-zone" scrollY="true">
      <div class="device-row" *ngFor="let action of scene.actions ;index as i">
        <div class="col1">
            <!-- <img src="assets/img/devices/{{devicename2img(action.deviceName)}}" /> -->
          <img src="assets/img/devices/{{devicename2img(action.deviceName)}}" onError="this.src='assets/img/devices/unknown.png'" />
        </div>
        <div class="col2">
          <div class="devicename">{{devicename2customName(action.deviceName)}}</div>
          <div class="deviceaction">{{action.content}}</div>
        </div>
        <div class="col3">
          <!-- <button class="device-del-button" ion-button outline (click)="delSceneDevice(i)">
            <ion-icon name="md-create"></ion-icon>
          </button> -->
          <button class="device-del-button" color="danger" ion-button outline (click)="delSceneDevice(i)">
            <ion-icon name="close"></ion-icon>
          </button>
        </div>
      </div>
    </ion-scroll>
    <button ion-button class="device-add-button" (click)="addScene()">
      添加设备动作
    </button>
  </div>
</ion-content>